

@echo off
setlocal enabledelayedexpansion

set "VENV_DIR=project_assistant"
set "PYTHON_SCRIPT=Main.py"

if not exist "%VENV_DIR%\" (
    echo Creating venv...
    python -m venv %VENV_DIR%
    if %ERRORLEVEL% neq 0 (
        echo error: not found python.
        exit /b 1
    )
    pip install openpyxl
)

echo activating...
call "%VENV_DIR%\Scripts\activate.bat"
if %ERRORLEVEL% neq 0 (
    echo error: activate error
    exit /b 1
)

echo running for %PYTHON_SCRIPT%
python "%PYTHON_SCRIPT%"
if %ERRORLEVEL% neq 0 (
    echo error: Python script.
    exit /b 1
)

echo all done.
pause
endlocal

